package com.example.demo.service;

import com.example.demo.dao.ArticleMapper;
import com.example.demo.dao.UserMapper;
import com.example.demo.model.ArticleInfo;
import com.example.demo.model.vo.UserInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @Author: wenjingyuan
 * @Date: 2023/08/01/10:40
 * @Description:
 */
@Service
public class ArticleService {
    @Autowired
    private ArticleMapper articleMapper;

    public List<ArticleInfo> getListByUid(int uid){
        return articleMapper.getListByUid(uid);
    }

    public int del(Integer aid,int uid){
        return articleMapper.del(aid,uid);
    }
    public int add(ArticleInfo articleInfo){
        return articleMapper.add(articleInfo);
    }

    public ArticleInfo getArticleByIdAndUid(int aid,int uid){
        return articleMapper.getArticleByIdAndUid(aid,uid);
    }

    public  int update(ArticleInfo articleInfo){
        return articleMapper.update(articleInfo);
    }

    public  ArticleInfo detail(int aid){
        return articleMapper.detail(aid);
    }

    public int getArtCount(int uid){
        return articleMapper.gerArtCount(uid);
    }

    public int incrementRcount(int aid){
        return articleMapper.incrementRcount(aid);
    }

    public List<ArticleInfo> getListBySize(int psize,int offset){
        return articleMapper.getListBySize(psize,offset);
    }
    public int getCount(){
        return articleMapper.gerCount();
    }
}
